import java.util.Arrays;
import java.util.List;

public class Client {
    public static void main(String[] args) {
        List<Element> elements = Arrays.asList(new ConcreteElementA(), new ConcreteElementB());

        ConcreteVisitor1 visitor1 = new ConcreteVisitor1();
        ConcreteVisitor2 visitor2 = new ConcreteVisitor2();

        for (Element element : elements) {
            element.accept(visitor1);
            element.accept(visitor2);
        }
    }
}